<g:setProvider library="jquery" />
<g:javascript library="pages/comic/showComic" />

<h1>Show Comic</h1>

<g:if test="${flash.message}">
	<div class="message">${flash.message}</div>
</g:if>

<table>
	<tbody>
		<tr class="prop">
			<td valign="top" class="name">Id:</td>
			<td valign="top" class="value">${fieldValue(bean:comicInstance,field:'id')}</td>
		</tr>

		<tr class="prop">
			<td valign="top" class="name">Name:</td>
			<td valign="top" class="value">${fieldValue(bean:comicInstance,field:'name')}</td>
		</tr>

		<tr class="prop">
			<td valign="top" class="name">Rating:</td>
			<td valign="top" class="value">${fieldValue(bean:comicInstance,field:'rating')}</td>
		</tr>

		<tr class="prop">
			<td valign="top" class="name">Comments:</td>
			<td valign="top" style="text-align: left;" class="value">
			<ul>
				<g:each var="c" in="${comicInstance.comments}">
					<li><g:link controller="comment" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
				</g:each>
			</ul>
			</td>
		</tr>

		<tr class="prop">
			<td valign="top" class="name">Created By:</td>
			<td valign="top" class="value">
				<g:link controller="user" action="show" id="${comicInstance?.createdBy?.id}">${comicInstance?.createdBy?.name.encodeAsHTML()}</g:link>
			</td>
		</tr>

		<tr class="prop">
			<td valign="top" class="name">Date Created:</td>
			<td valign="top" class="value">${fieldValue(bean:comicInstance,field:'dateCreated')}</td>
		</tr>

		<tr class="prop">
			<td valign="top" class="name">Description:</td>
			<td valign="top" class="value">${fieldValue(bean:comicInstance,field:'description')}</td>
		</tr>

		<tr class="prop">
			<td valign="top" class="name">Page:</td>
			<td valign="top" style="text-align: left;" class="value">
			<ul>
				<g:each var="p" in="${comicInstance.page}">
					<li><g:link controller="page" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>
				</g:each>
			</ul>
			</td>
		</tr>
	</tbody>
</table>